var ddd4 = "#fItem/Cash/0537.img/05370000/info/icon#"
var ddd5 = "#fItem/Cash/0548.img/05480000/info/icon#"
var tz20 = "#fEffect/CharacterEff/1114000/1/0#"; //红星花

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0 && status == 0) {
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
			var text = "#e#r  " + cm.getServerName() + "独特会员系统\r\n  ps:#n#k会员采用金字塔递进升级模式.会员完全免费换取.\r\n  #d不同会员等级增益属性不同!#g一次换取此角色永久特权!#l\r\n  #b您目前是本服的VIP#l:#r" + cm.getVip() + ";#l  #b当前的活跃值:#l#r" + cm.getPlayerPoints() + "#l#b点#l\r\n";
			text += "#b#L0#" + ddd4 + "#e#k每日会员工资#l ";
			text += "#b#L7#"+ "#n#b会员特权#l ";			
			text += "#b#L6#" + "#n#b工资明细#l\r\n";
			text += "#b#L1#" + ddd5 + "#e#r免费领取VIP1 - 新手必点！#l\r\n";
			text += "#b#L2#" + tz20 + "#e#bVIP#r1#b升级至VIP#r2 {#e您需要：#n#g80000  #e#rPPMS活跃值}#l\r\n";
			text += "#b#L3#" + tz20 + "#e#bVIP#r2#b升级至VIP#r3 {#e您需要：#n#g120000 #e#rPPMS活跃值}#l\r\n";
			text += "#b#L4#" + tz20 + "#e#bVIP#r3#b升级至VIP#r4 {#e您需要：#n#g160000 #e#rPPMS活跃值}#l\r\n";
			text += "#b#L5#" + tz20 + "#e#bVIP#r4#b升级至VIP#r5 {#e您需要：#n#g200000 #e#rPPMS活跃值}#l\r\n";
			cm.sendSimple(text);
		} else if (status == 1) {
			switch (selection) {
			case 0: //
			if (cm.getPQLog("VIP每日工资") < 1) {
			if (cm.getVip() == 1){
            	cm.gainMeso(500000);
				cm.gainItem(2711000,5);
				cm.gainItem(2049100,3);
				cm.gainItem(4001839,5);
				cm.gainItem(4001839,50);
				cm.gainNX(2,500);
				cm.gainNX(1,250);				
				}else if (cm.getVip() == 2){
            	cm.gainMeso(1000000);
				cm.gainItem(5062000,8);
				cm.gainItem(2049100,6);
				cm.gainItem(5390020,5);
				cm.gainItem(4001839,100);
				cm.gainNX(2,1000);
				cm.gainNX(1,500);				
				}else if (cm.getVip() == 3){
            	cm.gainMeso(1500000);
				cm.gainItem(5062002,5);
				cm.gainItem(2049122,6);
				cm.gainItem(5390026,5);
				cm.gainItem(4001839,150);
				cm.gainNX(2,1500);
				cm.gainNX(1,1000);				
				}else if (cm.getVip() == 4){
            	cm.gainMeso(2000000);
				cm.gainItem(5062000,6);
				cm.gainItem(5062002,6);				
				cm.gainItem(2049122,7);
				cm.gainItem(5390027,5);
				cm.gainItem(4001839,200);
				cm.gainNX(2,2000);
				cm.gainNX(1,1500);				
				}else if (cm.getVip() == 5){
            	cm.gainMeso(2500000);
				cm.gainItem(5062000,7);
				cm.gainItem(5062002,7);				
				cm.gainItem(2049122,8);
				cm.gainItem(5390027,5);
				cm.gainItem(4001839,250);
				cm.gainNX(2,2500);
				cm.gainNX(1,2000);				
				} 
				cm.setPQLog("VIP每日工资");
				cm.sendOk("恭喜您领取每日的VIP工资");
			} else {
				cm.sendOk("失败：\r\n\r\n#r1). 您已经领取过，请明日再领。");
				}
				cm.dispose();
				
				break;
			case 1: //免费领取VIP1
				if (cm.getVip() == 0) {
					cm.setVip(1, 30);
					cm.sendOk("恭喜您成为" + cm.getServerName() + "的VIP:#r" + cm.getVip() + "#l");
					cm.worldSpouseMessage(0x0A, "[会员系统]: 玩家 【" + cm.getChar().getName() + "】成功领取了" + cm.getServerName() + "的VIP1..");
				} else {
					cm.sendOk("您已经是VIP了,无需在领取了!您目前是VIP" + cm.getVip() +";");
				}
				cm.dispose();
				break;		
			case 2: //V1升V2
				if (cm.getVip() == 1) {
					if (cm.getPlayerPoints() >= 80000) {
						cm.setVip(2, 30);
						cm.gainPlayerPoints(-80000);
						cm.sendOk("恭喜您成为" + cm.getServerName() + "的VIP:#r" + cm.getVip() + "#l");
						cm.worldSpouseMessage(0x05, "[会员系统]: 玩家 【" + cm.getChar().getName() + "】成功从" + cm.getServerName() + "的VIP1升级至VIP2..");
					} else {
						cm.sendOk("您的活跃值好像还不够啊,您当前的活跃值是" + cm.getPlayerPoints() + "点");
					}
				} else {
					cm.sendOk("必须是VIP1才能升级到VIP2哟!您目前是VIP" + cm.getVip() +";");
				}
				cm.dispose();
				break;
			case 3://V2升V3
				if (cm.getVip() == 2) {
					if (cm.getPlayerPoints() >= 120000) {
						cm.setVip(3, 30);
						cm.gainItem(3700071,1);
						cm.gainItem(3010509,1);
						cm.gainPlayerPoints(-120000);
						cm.sendOk("恭喜您成为" + cm.getServerName() + "的VIP:#r" + cm.getVip() + "#l");
						cm.worldSpouseMessage(0x0A, "[会员系统]: 玩家 【" + cm.getChar().getName() + "】成功从" + cm.getServerName() + "的VIP2升级至VIP3..");
					} else {
						cm.sendOk("您的活跃值好像还不够啊,您当前的活跃值是" + cm.getPlayerPoints() + "点");
					}
				} else {
					cm.sendOk("必须是VIP2才能升级到VIP3哟!您目前是VIP" + cm.getVip() +";");
				}
				cm.dispose();
				break;
						case 7: //  充值中心
		                cm.dispose();
		                cm.openNpc(1530505, "会员特权介绍");
			            break;
			case 4://V3升V4
				if (cm.getVip() == 3) {
					if (cm.getPlayerPoints() >= 160000) {
						cm.setVip(4, 30);
						cm.gainItem(3700070,1);
						cm.gainItem(3010508,1);
						cm.gainPlayerPoints(-160000);
						cm.sendOk("恭喜您成为" + cm.getServerName() + "的VIP:#r" + cm.getVip() + "#l");
						cm.worldSpouseMessage(0x0A, "[会员系统]: 玩家 【" + cm.getChar().getName() + "】成功从" + cm.getServerName() + "的VIP3升级至VIP4..");
					} else {
						cm.sendOk("您的活跃值好像还不够啊,您当前的活跃值是" + cm.getPlayerPoints() + "点");
					}
				} else {
					cm.sendOk("必须是VIP3才能升级到VIP4哟!您目前是VIP" + cm.getVip() +";");
				}
				cm.dispose();
				break;
			case 5://V4升V5
				if (cm.getVip() == 4) {
					if (cm.getPlayerPoints() >= 200000) {
						cm.setVip(5, 30);
						cm.gainItem(3700069,1);
						cm.gainItem(3010507,1);
						cm.gainPlayerPoints(-200000);
						cm.sendOk("恭喜您成为" + cm.getServerName() + "的VIP:#r" + cm.getVip() + "#l");
						cm.worldSpouseMessage(0x0A, "[会员系统]: 玩家 【" + cm.getChar().getName() + "】成功从" + cm.getServerName() + "的VIP4升级至VIP5..");
					} else {
						cm.sendOk("您的活跃值好像还不够啊,您当前的活跃值是" + cm.getPlayerPoints() + "点");
					}
				} else {
					cm.sendOk("必须是VIP4才能升级到VIP5哟!您目前是VIP" + cm.getVip() +";");
				}
				cm.dispose();
				break;
			default:
				cm.sendOk("[PPMS会员工资表]：\r\nVip①:#v2711000#x5  #v2049100#x3 #v5390010#x5 #v4001839#x100\r\n赠送点卷:250 抵用卷:500 冒险币:50W \r\nVip②:#v5062000#x5 #v2049100#x6 #v5390020#x5 #v4001839#x150\r\n赠送点卷:500 抵用卷:1000 冒险币:100W \r\nVip③:#v5062002#x5  #v2049122#x6 #v5390026#x5 #v4001839#x200\r\n赠送点卷:1000 抵用卷:1500 冒险币:150W\r\nVip④:#v5062000#x6 #v5062002#x6 #v2049122#x7 #v5390027#x5 #v4001839#x250\r\n赠送点卷:1500 抵用卷:2000 冒险币:200W \r\nVip⑤:#v5062000#x7 #v5062002#x7 #v2049122#x8 #v5390028#x5 #v4001839#x300\r\n赠送点卷:2000 抵用卷:2500 冒险币:250W");
				cm.dispose();
			}
		}
	}
}
